     //
//  UIImage+Ext.h
//  xuzhq
//
//  Created by xuzhq on 12-12-18.
//  Copyright (c) 2012年 xuzhq. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (XLExtension)

- (UIImage *)imageScaleToSize:(CGSize)size;

- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize;


+ (UIImage *)fixOrientation:(UIImage *)aImage;

+ (UIImage *)circleImageWithName:(UIImage *)oldImage borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor;

+ (UIImage*)convertViewToImage:(UIView*)v;

+(UIImage*)getSubImage:(UIImage*)image rect:(CGRect)rect;

//- (id)initWithContentsOfName:(NSString *)name;
+ (UIImage *)imageWithContentsOfName:(NSString *)name;
//- (UIImage *)imageByScalingToSize:(CGSize)targetSize;
+ (UIImage *)imageWithColor:(UIColor *)color;

+ (UIImage *)imageDeviceWithImageName:(NSString *)imgName;
+ (UIImage *)imageiPhone5LessWithImageName:(NSString *)imageName;

// Generate qr code image
+ (UIImage *)buildQRCodeImg:(NSString *)qrCode;


+(UIImage*)image:(UIImage *)image scaleToSize:(CGSize)size;
+(UIImage *)imageFromImage:(UIImage *)image inRect:(CGRect)rect;

+ (UIImage *)imageWithOriginal:(NSString *)imageName;
@end
